<template>
  <div class="hello">
    <div class="list_wrapper" v-for="(item,index) in data">
      <router-link :to="{path:'/day_info',query:{id:item.kdaykey}}" tag="div" class="router-link">
        <section class="list_item" >
          <div class="list_item_img">
            <img src="../assets/normal@2x.png" alt="" class="list_img">
          </div>
          <div class="list_item_info">
            <div class="list_item_info_status">{{item.kdayresult}}</div>
            <div class="list_item_info_detail">
              <span class="list_item_info_detail_time" v-bind:class="{'normal-text':item.kdaytime1 == 1,'uncheck-text':item.kdaytime1 == 0,'error-text': item.kdaytime1 == -1}"> Ⅰ </span>
              <span class="list_item_info_detail_time" v-bind:class="{'normal-text':item.kdaytime1 == 1,'uncheck-text':item.kdaytime1 == 0,'error-text': item.kdaytime1 == -1}"> Ⅱ </span>
              <span class="list_item_info_detail_time" v-bind:class="{'normal-text':item.kdaytime1 == 1,'uncheck-text':item.kdaytime1 == 0,'error-text': item.kdaytime1 == -1}"> Ⅲ </span>
              <span class="list_item_info_detail_time" v-bind:class="{'normal-text':item.kdaytime1 == 1,'uncheck-text':item.kdaytime1 == 0,'error-text': item.kdaytime1 == -1}"> Ⅳ </span>
              <span class="list_item_info_detail_time" v-bind:class="{'normal-text':item.kdaytime1 == 1,'uncheck-text':item.kdaytime1 == 0,'error-text': item.kdaytime1 == -1}"> Ⅴ </span>
              <span class="list_item_info_detail_action">{{item.kdaydate.substr(0,10)}}</span>
            </div>

          </div>
          <div class="onepx"></div>
        </section>
      </router-link>
    </div>
  </div>
</template>

<script>
  import  data  from '../api/day_list.json'
export default {
  name: 'day_list',
  methods: {
    fetchmydata: function (url) {
      fetch(url, {
        method: 'get',
        headers: {
          "Content-type": "application/json; charset=UTF-8"
        }
      })
        .then(function (response) {
          return response.json();
        })
        .then(function (data) {
          console.log('Request succeeded with JSON response', data);
        })
        .catch(function (error) {
          console.log('Request failed', error);
        });
    }
  },
  data () {
    return data;
  }
}


</script>

<style  lang='less'>
  #app {
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;

    margin:0 auto;
    padding:0;
    margin-top: 60px;
    width: 100%;
  }

  .onepx {
    min-height: 4rem;
    margin-top: -1px;
    background: -webkit-gradient(linear, left top, left bottom, from(#fff), color-stop(.5, #fff), color-stop(.5, transparent)) top left no-repeat, -webkit-gradient(linear, left top, left bottom, from(#fff), to(#fff)) bottom left no-repeat, -webkit-gradient(linear, left top, left bottom, from(#e5e5e5), color-stop(.5, #e5e5e5), color-stop(.5, transparent)) top left no-repeat, -webkit-gradient(linear, left top, left bottom, from(#e5e5e5), to(#e5e5e5)) bottom left no-repeat, #fff;
    -webkit-background-size: 0 0, 0 0, 100% 1px, 100% 1px;
    -webkit-box-align: center;
    -webkit-align-items: center;
  }
  .list_wrapper {
    background: #ffffff;
    width: 100%;
    height: auto;
    overflow: hidden;
    display: block;
  }
  .router-link {
    display: block;
  }
  .list_item {
    padding-top: 8px;

    /*border-bottom: 1px solid #e5e5e5;*/
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
  }
  .list_item_img {
    width: 27%;
    float: left;
    overflow: hidden;
    position: relative;
    margin-right: 8px;
  }
  .list_img {
    float: left;
    width :50px;
    height : 40px;
  }
  .list_item_info {
    float: left;
    font-size: 0px;

  }
  .list_item_info_status {
    float: left;
    width: 100%;
    text-align: left;
    font-size: 13px;
  }
  .list_item_info_detail {
    float:left;
    padding-top: 10px;
    width: 100%;
  }
  .list_item_info_detail_time {

    .error-text {
      color:red;
    }
    .uncheck-text {
      color:gray;
    }
    .normal-text {
      color:blue;
    }
     font-size:13px;
     line-height: 13px;
     float:left;
     text-align: left;
     display: block;
     margin-right: 8px;

   }


  .list_item_info_detail_time1 {
    font-size:12px;
    line-height: 12px;
    float:left;
    text-align: left;
    display: block;
    margin-right: 8px;
    color: orangered;
  }
  .list_item_info_detail_action {
    font-size:12px;
    padding-left : 50px;
    text-align: left;
    line-height: 12px;
    float:left;
    display: block;
  }
  .list_content {

    list-style: none;
    align-items: left;
    font-size: 12px;
    font-family: sans-serif;
    padding: 0; margin-bottom: 4em;
    text-shadow: 0 1px 0 rgba(255,255,255,.5);
  }

</style>
